﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "IElementPositionPoints.h"

namespace gcmp {

    class IInstance;

    /// \brief Instance控制点行为接口
    ///
    /// Instance提供了通过控制点来操作其位置和形状的行为，Instance具有控制点时需要重写此接口
    class GCMP_MODEL_INTERFACE_EXPORT IInstancePositionPoints : public IElementPositionPoints
    {
        DEFINE_CAST_DERIVED(gcmp::IInstancePositionPoints, gcmp::IElementPositionPoints);

    public:
        /// \brief 创建基于定位的控制点行为
        ///
        /// 其所属Instance的定位不能为空，控制点个数及坐标直接从其定位获取，
        /// 设置控制点会直接给其定位,并更新长度参数和坐标系参数
        /// \param pElement IInstancePositionPoints所属的Element指针
        /// \return 控制点行为指针
        static OwnerPtr<IInstancePositionPoints> CreateBaseOnElementPosition(IInstance* pInstance);
    };
}// namespace gcmp

